#ifndef H_NET_SESSIONMANAGER_H
#define H_NET_SESSIONMANAGER_H

#include "../core/hash.h"

namespace QinChat{
    namespace Net{
        class CSession;

        class CSessionManager{
            public:
                explicit CSessionManager();
                ~CSessionManager();

                bool Push(std::shared_ptr<CSession> pSession);
                std::shared_ptr<CSession> Find(int fd) const;
                bool Remove(int fd);

            protected:
                void Init(void);
                void Clear(void);

            private:
                Core::Hash<std::shared_ptr<CSession> > m_hashSession;
        };
    }
}

#endif // !H_NET_SESSIONMANAGER_H